﻿/*
 * Jonathan.Tests
 * Created by: Jonathan Montiverdi
 * Date: 6/13/2012
 * License: http://jonathan.codeplex.com/license
 */
using System.IO;
using Jonathan.Data;
using NUnit.Framework;

namespace Jonathan.Tests.Data
{
   /// <summary>
   /// Tests the book object in Jonathan.
   /// </summary>
   [TestFixture]
   public class TestBook
   {
      /// <summary>
      /// Tests the properties of the book object.
      /// </summary>
      [Test]
      public void TestProperties()
      {
         var book = new Book ();
         book.Name = "TempBook";
         Assert.AreEqual ("TempBook", book.Name, "Book name property failed.");
         var tempPath = Path.GetTempFileName ();
         book.FileName = tempPath;
         Assert.AreEqual (tempPath, book.FileName, "Book name property failed.");
         Assert.IsFalse (book.FileExists);
         book.UpdateAutomatically = true;
         Assert.IsTrue (book.UpdateAutomatically);
         book.UpdateAutomatically = false;
         Assert.IsFalse (book.UpdateAutomatically);
      }
   }
}
